package com.apartment.own.service.impl;

import java.util.List;
import com.apartment.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.apartment.own.mapper.OwnAccountInstallmentMapper;
import com.apartment.own.domain.OwnAccountInstallment;
import com.apartment.own.service.IOwnAccountInstallmentService;

/**
 * 账单分期Service业务层处理
 * 
 * @author @Dog_E
 * @date 2020-08-28
 */
@Service
public class OwnAccountInstallmentServiceImpl extends ServiceImpl<OwnAccountInstallmentMapper,OwnAccountInstallment> implements IOwnAccountInstallmentService
{
    @Autowired
    private OwnAccountInstallmentMapper ownAccountInstallmentMapper;

    /**
     * 查询账单分期
     * 
     * @param id 账单分期ID
     * @return 账单分期
     */
    @Override
    public OwnAccountInstallment selectOwnAccountInstallmentById(Long id)
    {
        return ownAccountInstallmentMapper.selectOwnAccountInstallmentById(id);
    }

    /**
     * 查询账单分期列表
     * 
     * @param ownAccountInstallment 账单分期
     * @return 账单分期
     */
    @Override
    public List<OwnAccountInstallment> selectOwnAccountInstallmentList(OwnAccountInstallment ownAccountInstallment)
    {
        return ownAccountInstallmentMapper.selectOwnAccountInstallmentList(ownAccountInstallment);
    }

    /**
     * 新增账单分期
     * 
     * @param ownAccountInstallment 账单分期
     * @return 结果
     */
    @Override
    public int insertOwnAccountInstallment(OwnAccountInstallment ownAccountInstallment)
    {
        ownAccountInstallment.setCreateTime(DateUtils.getNowDate());
        return ownAccountInstallmentMapper.insertOwnAccountInstallment(ownAccountInstallment);
    }

    /**
     * 修改账单分期
     * 
     * @param ownAccountInstallment 账单分期
     * @return 结果
     */
    @Override
    public int updateOwnAccountInstallment(OwnAccountInstallment ownAccountInstallment)
    {
        ownAccountInstallment.setUpdateTime(DateUtils.getNowDate());
        return ownAccountInstallmentMapper.updateOwnAccountInstallment(ownAccountInstallment);
    }

    /**
     * 批量删除账单分期
     * 
     * @param ids 需要删除的账单分期ID
     * @return 结果
     */
    @Override
    public int deleteOwnAccountInstallmentByIds(Long[] ids)
    {
        return ownAccountInstallmentMapper.deleteOwnAccountInstallmentByIds(ids);
    }

    /**
     * 删除账单分期信息
     * 
     * @param id 账单分期ID
     * @return 结果
     */
    @Override
    public int deleteOwnAccountInstallmentById(Long id)
    {
        return ownAccountInstallmentMapper.deleteOwnAccountInstallmentById(id);
    }
}
